package xiegd.com.springbootuse.demo.primarystudy;

import com.alibaba.fastjson.JSONObject;

import java.util.Date;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * @Description:
 * @Author: xieguangda
 * @Date: 2021年08月19日 13:56
 */
public class eightOneNight {

    private static Pattern pattern = Pattern.compile("[0-9]{1,}");

    public static void main(String[] args) {
            String remark = "我是:888811\r\n测试从：2222\r\njfdaiof";
            String[] split = remark.split("\\r?\\n");//分割\n
            if(split!= null && split.length == 2 && split[0].length()>3 && split[1].length()>4){

                String counselorCode = split[0].substring(3);//顾问编码
                String cleanerCode = split[1].substring(4);//清洁师编号

                Matcher matcher = pattern.matcher((CharSequence)counselorCode);
                boolean counselorCodeBoolean=matcher.matches();
                Matcher matcher1 = pattern.matcher((CharSequence) cleanerCode);
                boolean cleanerCodeBoolean = matcher1.matches();
                System.out.println("是否是整数：" + counselorCodeBoolean + "," + cleanerCodeBoolean);


            }
    }
}
